/*
 ============================================================================
 Name		: RecognitionManager.h
 Author	  : Lenka Litvova
 Version	 : 1.0
 Copyright   : Your copyright notice
 Description : CRecognitionManager declaration
 ============================================================================
 */

#ifndef RECOGNITIONMANAGER_H
#define RECOGNITIONMANAGER_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include "RecognitionObserver.h"
#include "AuthetificationObserver.h"
#include "FaceRecognizer.h"
#include "FaceAuthetificator.h"

class CFRamI_UIAppUi;

// CLASS DECLARATION

/**
 *  CRecognitionManager
 * 
 */
class CRecognitionManager : public CBase, public MRecognitionObserver, public MAuthetificationObserver
	{
public:
	// Constructors and destructor

	/**
	 * Destructor.
	 */
	~CRecognitionManager();

	/**
	 * Two-phased constructor.
	 */
	static CRecognitionManager* NewL(CFRamI_UIAppUi *aAppUi);

	/**
	 * Two-phased constructor.
	 */
	static CRecognitionManager* NewLC(CFRamI_UIAppUi *aAppUi);
	
	void RecognizeAuthorized(CNokiaCVImage *aImage, TDesC& aUsername);
	
	void Authetificate(CNokiaCVImage *aImage);
	
public://from MRecognitionObserver
	 void RecognitionFinishedL(TRecognitionState aState);
	 
public: //from MAuthetificationObserver
	 void AuthetificationFinishedL(TBool aResult);
	 
private:

	/**
	 * Constructor for performing 1st stage construction
	 */
	CRecognitionManager(CFRamI_UIAppUi *aAppUi);

	/**
	 * EPOC default constructor for performing 2nd stage construction
	 */
	void ConstructL();

private:
	TBool iAuthetificationMode;
	
	CFaceRecognizer *iRecognizer;
	CFaceAuthetificator *iAuthetificator;
	
	TDesC *iUserTested;
	
	CFRamI_UIAppUi *iAppUi;
	};

#endif // RECOGNITIONMANAGER_H
